package com.longdaji.decoration.ui.goodslist;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.view.ViewGroup;

import com.longdaji.decoration.base.BaseFragment;

import java.util.List;

/**
 * 适配器
 * Created by qiudengjiao on 2017/5/6.
 */

public class GoodsListSelectTabAdapter extends FragmentPagerAdapter {

    private String[] mTitles;
    private List<BaseFragment> mFragments;

    public GoodsListSelectTabAdapter(FragmentManager fm, List<BaseFragment> fragments, String[] titles) {
        super(fm);
        this.mFragments = fragments;
        this.mTitles = titles;

    }


    @Override
    public Fragment getItem(int position) {
        return mFragments.get(position);
    }

    @Override
    public int getCount() {
        return mFragments.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return mTitles[position];
    }

    @Override
    public void destroyItem(ViewGroup container, int position, Object object) {
        //container.removeView(container.getChildAt(position));
    }

}
